/*!  \file  Stack.h
 *	  \brief  
 * 
 *   \details   details
 *   \author    Yordan Madzhunkov German Research School for Simulation Sciences GmbH
 *   \version   1.0
 *   \date      07/16/2013 10:18:01 AM
 *   \copyright GNU Public License.
 */
#pragma once
template <typename T>
class Stack {
public:
	Stack(const int maxSize);
	virtual ~Stack();

	bool push   (const T   id);
	bool tryPush(const T   id);

	bool pop    (      T & id);
	bool tryPop (      T & id);

	void reset();
	bool isEmpty() { return count == 0; };
private:
	DISALLOW_COPY_AND_ASSIGN(Stack);
	Lock countLock;
	T * RS storage;
	int maxSize, count;
};
